package main

import "fmt"

func main()  {
	nums:=[]int{2,3,4,5}
	sum:=0
	// 迭代
	for i,num := range nums {
		fmt.Println(i,num)
		sum += num
	}

	fmt.Println("sum:",sum)

	kvs := map[string]string{"a":"apple","b":"banana"}
	for k,v := range kvs{
		fmt.Printf("%s -> %s\n",k,v)
	}

	for i, c := range "golang" {
        fmt.Printf("%v->%s\n",i, string(c))
    }
}